﻿@{
    Layout = "~/Views/Shared/_PopupLayout.cshtml";
}

@model LineOfBusiness.Poco.SR_tblCustomers

@Html.LOBHtmlHelper().Busy("pupopBusy")
@{Html.LOBHtmlHelper().tdLable("120");}

<style> 
 fieldset {
    margin: 8px;
    border: 1px solid silver;
    padding: 8px;    
    border-radius: 4px;
}
legend{
    padding: 2px;        
}
</style>
 
<div>
    <form id="frm">
        <table style="width:100%;padding-left:15px;padding-right:15px">
            <tr>
                <td class="tdLabel">
                    @Html.LOBHtmlHelper().Label("lblCustomerID", "CustomerID")
                </td>
                <td >
                    @Html.LOBHtmlHelper().InputFor("CustomerID", InputType.Text, "40")
                </td>
            </tr>
        
            <tr>
                <td class="tdLabel">
                    @Html.LOBHtmlHelper().Label("lblCustomerName", "CustomerName")
                </td>
                <td>
                    @Html.LOBHtmlHelper().InputFor("CustomerName", InputType.Text, 1)
                
                </td>
               
            </tr>

            <tr>
                <td class="tdLabel">
                    @Html.LOBHtmlHelper().Label("lblAddress", "Address")
                </td>
                <td>
                    @Html.LOBHtmlHelper().InputFor("Address", InputType.Text, 1)
                </td>
            </tr>

            <tr>
                <td class="tdLabel">
                    @Html.LOBHtmlHelper().Label("lblPhone1", "Phone1")
                </td>
                <td>
                    @Html.LOBHtmlHelper().InputFor("Phone1", InputType.Text, 1)
                </td>
            </tr>

            <tr>
                <td class="tdLabel">
                    @Html.LOBHtmlHelper().Label("lblPhone2", "Phone2")
                </td>
                <td>
                    @Html.LOBHtmlHelper().InputFor("Phone2", InputType.Text, 1)
                </td>
            </tr>
            <tr>
                <td class="tdLabel">
                    @Html.LOBHtmlHelper().Label("lblHandPhone", "HandPhone")
                </td>
                <td>
                    @Html.LOBHtmlHelper().InputFor("HandPhone", InputType.Text, 1)
                </td>
            </tr>
            <tr>
                <td class="tdLabel">
                    @Html.LOBHtmlHelper().Label("lblEmail", "Email")
                </td>
                <td>
                    @Html.LOBHtmlHelper().InputFor("Email", InputType.Text, 1)
                </td>
            </tr>
            <tr>
                <td class="tdLabel">
                    @Html.LOBHtmlHelper().Label("lblWebsite", "Website")
                </td>
                <td>
                    @Html.LOBHtmlHelper().InputFor("Website", InputType.Text, 1)
                </td>
            </tr>
            <tr>
                <td class="tdLabel">
                    @Html.LOBHtmlHelper().Label("lblContactName", "ContactName")
                </td>
                <td>
                    @Html.LOBHtmlHelper().InputFor("ContactName", InputType.Text, 1)
                </td>
            </tr>
        </table>

        <div id="_blank" style="height:25px"></div>
    </form>
</div>

<div class="Line">
</div>

<div  style="text-align:right">
    <div class="buttons">
        @if(ViewBag.Edit!=-1)
        {
            <button id="btnSave" class="positive" onclick= "SavePopup()">
                <img src="@Html.BaseUrl()Content/images/toolbar/save.png" alt="" /> 
                @Html.LOBHtmlHelper().C("Save") 
            </button> 
        }
        <button class="positive" onclick= "Close()">
            <img src="@Html.BaseUrl()Content/images/toolbar/close.png" alt="" /> 
            @Html.LOBHtmlHelper().C("Close")
        </button> 
    </div>
</div>

<script type="text/javascript">

    var codeBasePopup = new CodeBasePopup();

    $(document).ready(function () {

        codeBasePopup.init('@ViewBag.Edit', "CustomerID", "@Url.Action("Save", "Customers")", '@Model.CustomerID', "", 80);

        setTimeout(function () { $("#CustomerID").focus(); }, 500);

    });
    function SavePopup() {
        codeBasePopup.SavePopup();
    }

    function Close() {
        codeBasePopup.Close();
    }
</script>